package com.example.config;

import com.example.interceptor.IdInterceptor;
import com.example.service.impl.FlowServiceImpl;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Description:
 * @Author: aimi
 * @Create: 2024-05-17
 **/
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Resource
    private FlowServiceImpl flowService;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new IdInterceptor(flowService)).addPathPatterns("/**");
    }
}